// general.c

//#include "verisilicon8051.h"

#include "bl6810.h"
#include "stdio.h"
#include "uart.h"


/*unsigned char BytesCmp(unsigned char *pt1, unsigned char *pt2, unsigned char len)
{
	unsigned char i;
	for(i=0;i<len;i++)
	{
		if(pt1[i]!=pt2[i])
		{
			return(0);
		}
	}
	return(1);

}*/


unsigned char round(float x)
{
	unsigned int y;		// y need to be a larger range to prevent overflow
	
	y = x*2;
	y = (y & 0x0001)? ((y>>1)+1) : (y>>1);
	return (unsigned char)(y);
}
